package com.example.demoexp02;

import org.springframework.boot.CommandLineRunner;
import org.springframework.core.env.Environment;

import java.util.Objects;

@SuppressWarnings("unused")
class CustomCommandLineRunner implements CommandLineRunner {
    Environment env;

    public CustomCommandLineRunner(Environment env){
        this.env = env;
    }
    @Override
    public void run(String... args){
        System.out.println("利用spring Boot自动装配CommandLineRunner");
        System.out.println("夏后文实验二生成随机一个字符串：".concat(Objects.requireNonNull(env.getProperty("random."))));
    }
}
